/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.crossSection;

import java.util.ArrayList;

import br.ufmg.dees.insane.materialMedia.materialPoint.MaterialPoint;

/**
 *A class representing DiscretizedCrossSection.<p>
 *
 *@author CENOURA!!!
 *@version 1.0
 *@since 28/04/2005
 */
public class DiscretizedCrossSection implements CrossSection {

    /** The label of this CrossSection. */
	protected String label;
	
	/** The area of this CrossSection. */
	protected double area;
	
	/** The moment of inertia about the local Y axis of this CrossSection.*/
	protected double iy;
	
	/** The moment of inertia about the local Z axis of this CrossSection.*/
	protected double iz;
    
	/** The the list of maerial points of this CrossSection.*/
	protected ArrayList<MaterialPoint> materialPoints = new ArrayList<MaterialPoint>();
	
//	********************************************************************************
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.crossSection.CrossSection#getLabel()
     */
	public String getLabel()
	{
		return (label);
	}
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.crossSection.CrossSection#setLabel(java.lang.String)
     */
	public void setLabel(String a)
	{
		label = a;
	}
	
//********************************************************************************
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.crossSection.CrossSection#getArea()
     */
	public double getArea()
	{
		double a=0;
	    for(int i=0;i<this.getNumberOfPoints();i++){
		    a+=this.getMaterialPoint(i).getVolumeValue();
		}
	    return a;
	}
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.crossSection.CrossSection#setArea(double)
     */
	public void setArea(double a)
	{
		area = a;
	}
	
//********************************************************************************
		
	 /* (non-Javadoc)
     * @see br.ufmg.dees.insane.crossSection.CrossSection#getIy()
     */
	public double getIy()
	{
		return (iy);
	}
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.crossSection.CrossSection#setIy(double)
     */
	public void setIy(double a)
	{
		iy = a;
	}
	
//********************************************************************************
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.crossSection.CrossSection#getIz()
     */
	public double getIz()
	{
		return (iz);
	}
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.crossSection.CrossSection#setIz(double)
     */
	public void setIz(double a)
	{
		iz = a;
	}

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.model.disc.crossection.CrossSection#getIx()
     */
    public double getIx() {
        // TODO Auto-generated method stub
        return 0;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.model.disc.crossection.CrossSection#setIx(double)
     */
    public void setIx(double a) {
        // TODO Auto-generated method stub
        
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.model.disc.crossection.CrossSection#getHeight()
     */
    public double getHeight() {
        // TODO Auto-generated method stub
        return 0;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.model.disc.crossection.CrossSection#setHeight(double)
     */
    public void setHeight(double a) {
        // TODO Auto-generated method stub
        
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.model.disc.crossection.CrossSection#getThickness()
     */
    public double getThickness() {
        // TODO Auto-generated method stub
        return 0;
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.model.disc.crossection.CrossSection#setThickness(double)
     */
    public void setThickness(double a) {
        // TODO Auto-generated method stub
        
    }
	
    /** Add a material point to the list of this cross section.
	*@param mp The material point to be added to the list of this cross section.
	*/
    public void add(MaterialPoint mp){
    	this.materialPoints.add(mp);
    }
    
    /** Remove a material point from the list of this cross section.
	*@param i The index of the material point to be removed from the list of this cross section.
	*/
    public void remove(int i){
    	this.materialPoints.remove(i);
    }
    
    /** Returns the number of materialpoints of this CrossSection.
	*@return The number of materialpoints of this CrossSection.
	*/
    public int getNumberOfPoints(){
    	return this.materialPoints.size();
    }
    
    /** Returns a materialpoint of this CrossSection.
    *@param i The index of the material point.
    *@return A materialpoint of this CrossSection.
	*/
    public MaterialPoint getMaterialPoint(int i){
    	return (MaterialPoint)this.materialPoints.get(i);
    }
    
//********************************************************************************

}
